const areaList = [
    { province: "北京", province_code: "11" },
    { province: "天津", province_code: "12" },
    { province: "河北", province_code: "13" },
    { province: "山西", province_code: "14" },
    { province: "内蒙古", province_code: "15" },
    { province: "辽宁", province_code: "21" },
    { province: "吉林", province_code: "22" },
    { province: "黑龙江", province_code: "23" },
    { province: "上海", province_code: "31" },
    { province: "江苏", province_code: "32" },
    { province: "浙江", province_code: "33" },
    { province: "安徽", province_code: "34" },
    { province: "福建", province_code: "35" },
    { province: "江西", province_code: "36" },
    { province: "山东", province_code: "37" },
    { province: "河南", province_code: "41" },
    { province: "湖北", province_code: "42" },
    { province: "湖南", province_code: "43" },
    { province: "广东", province_code: "44" },
    { province: "广西", province_code: "45" },
    { province: "海南", province_code: "46" },
    { province: "重庆", province_code: "50" },
    { province: "四川", province_code: "51" },
    { province: "贵州", province_code: "52" },
    { province: "云南", province_code: "53" },
    { province: "西藏", province_code: "54" },
    { province: "陕西", province_code: "61" },
    { province: "甘肃", province_code: "62" },
    { province: "青海", province_code: "63" },
    { province: "宁夏", province_code: "64" },
    { province: "新疆", province_code: "65" }
]

export function getAreaList() {
    return areaList
}

export function getAreaName(code){
    const index = areaList.findIndex(item => item.province_code === (code + ''))
    if(index >= 0){
        return areaList[index].province
    }else{
        return '--'
    }
}